<?php
namespace Admin\Controller;
use \Admin\Model\CommonModel;
include "./Common/CheckAdmin.php";
final class CommonController{
	//显示视图
	public function showCommon(){
		$commonModelObj = new CommonModel();
		$arr = $commonModelObj -> getCommon();
		include VIEW_PATH."editCommon.html";
	}
	
	//修改的方法
	public function editCommon(){
		$phone = $_POST['phone'];
		$email = $_POST['email'];
		$address = $_POST['address'];
		$about = $_POST['about'];
		
		$commonModelObj = new CommonModel();
		$row = $commonModelObj -> editCommon($phone,$email,$address,$about);
		if($row==1){
			echo 200;
		}else{
			echo 500;
		}
	}
}
?>